// PropertyRuntime.h: interface for the PropertyRuntime class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PROPERTYRUNTIME_H__E035EA8C_ECEE_46E3_9E3D_E0038B42489E__INCLUDED_)
#define AFX_PROPERTYRUNTIME_H__E035EA8C_ECEE_46E3_9E3D_E0038B42489E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

namespace pa
{
	class PropertyParser;
	struct PropertyRuntimeClass
	{
		PropertyParser* (PASCAL* m_createobject)(); 
		PropertyRuntimeClass* p_nRuntime;
		LPCSTR strClassName;
		static PropertyRuntimeClass* p_fRuntime;
		PropertyParser* CreateObject();
	};

	struct Afx_Initclass
	{
		Afx_Initclass(PropertyRuntimeClass* pNewClass);
	};

	#define UE_DECLARE_DYNPROPERTY(class_name)\
	public:\
	static PropertyRuntimeClass v_##class_name;

	#define UE_DECLARE_DYNPROPERTYCREATE(class_name)\
	UE_DECLARE_DYNPROPERTY(class_name)\
	static PropertyParser* PASCAL CreateObject();	 

	#define UE_IMPLEMENT_ELEMENT(class_name,m_create)\
	static char str##class_name[] = #class_name;\
	PropertyRuntimeClass class_name::v_##class_name = {m_create,NULL,str##class_name};\
	static Afx_Initclass init_##class_name(&class_name::v_##class_name);


	#define UE_IMPLEMENT_DYNPROPERTY(class_name)\
	UE_IMPLEMENT_ELEMENT(class_name,NULL)
		  

	#define UE_IMPLEMENT_DYNPROPERTYCREATE(class_name)\
	UE_IMPLEMENT_ELEMENT(class_name,class_name::CreateObject)\
	PropertyParser* PASCAL class_name::CreateObject()\
	{return new class_name;}

	class PropertyRuntime  
	{
	public:
		PropertyRuntime();
		virtual ~PropertyRuntime();

	};
};
#endif // !defined(AFX_PROPERTYRUNTIME_H__E035EA8C_ECEE_46E3_9E3D_E0038B42489E__INCLUDED_)
